package com.scott.decorator;

import org.junit.Test;

import com.scott.decorator.common.children.NiuRouMianTiao;
import com.scott.decorator.common.father.MianTiao;
import com.scott.decorator.special.children.AddJidan;
import com.scott.decorator.special.children.AddNiuRou;

public class Client {
	
	@Test
	public void decortor(){
		//一般的牛肉面
		MianTiao miantiao = new NiuRouMianTiao("牛肉面");
		System.out.println("面条的名字=["+miantiao.getName() +"],价格=["+miantiao.getPrice()+"]。");
		
		//增加了鸡蛋的牛肉面
		miantiao = new AddJidan(miantiao);
		System.out.println("面条的名字=["+miantiao.getName() +"],价格=["+miantiao.getPrice()+"]。");
		
		miantiao = new AddNiuRou(miantiao);
		System.out.println("面条的名字=["+miantiao.getName() +"],价格=["+miantiao.getPrice()+"]。");
		
		
	}

}
